sniper = {'form': {'fields': [{'field': 'id', 'null': False, 'type': 'int'},
                     {'field': 'name', 'null': False, 'type': 'var_char'},
                     {'field': 'url', 'null': False, 'type': 'var_char'},
                     {'field': 'parent_form_id',
                      'null': False,
                      'type': 'int'},
                     {'field': 'leaf_node', 'null': False, 'type': 'char'}],
          'primary_key': ['id'],
          'relations': [],
          'unique_keys': []},
 'price': {'fields': [{'field': 'product_id', 'null': False, 'type': 'int'},
                      {'field': 'get_time',
                       'null': False,
                       'type': 'datetime'},
                      {'field': 'price', 'null': False, 'type': 'int'}],
           'primary_key': ['product_id', 'get_time'],
           'relations': [('product_id', 'product', 'id')],
           'unique_keys': []},
 'product': {'fields': [{'field': 'id', 'null': False, 'type': 'int'},
                        {'field': 'name', 'null': False, 'type': 'var_char'},
                        {'field': 'form_id', 'null': False, 'type': 'int'},
                        {'field': 'interested',
                         'null': False,
                         'type': 'char'}],
             'primary_key': ['id'],
             'relations': [('form_id', 'form', 'id')],
             'unique_keys': []}}



from leazy.db.dbop import DataBase
from etc.config import db_config

reader = DataBase(sniper, **db_config['reader'])
writer = DataBase(sniper, **db_config['writer'])

__all__ = [ "reader", "writer", ]
